package com.alibaba.algo.cooperation.usercomponent.service.user;

import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.common.PagerEntity;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.*;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.GetChildOrgListByParentIdResponseVO;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.GetFirstLevelOrgResponseVO;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.SelectOrgByCodeResponseVO;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.SelectOrgDetailResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 类SysOrgService.java的实现描述：组织机构 service
 *
 * @author nieganggang 2021-03-12 16:08:17
 */
@FeignClient(url="${feign.userCenterUrl:}", value = "usercenter-service", contextId = "usercenter-app")
public interface SysOrgService {

    @RequestMapping(value = "/sysOrg/insert", method = RequestMethod.POST)
    BaseResult insert(@RequestBody SysOrgCreateRequestVO sysOrgCreateRequestVO);

    @RequestMapping(value = "/sysOrg/delete", method = RequestMethod.POST)
    BaseResult delete(@RequestBody SysOrgDelRequestVO sysOrgDelRequestVO);

    @RequestMapping(value = "/sysOrg/deleteForSync", method = RequestMethod.POST)
    BaseResult deleteForSync(@RequestBody SysOrgDelRequestVO param);

    @RequestMapping(value = "/sysOrg/update", method = RequestMethod.POST)
    BaseResult update(@RequestBody SysOrgUpdateRequestVO sysOrgUpdateRequestVO);

    /**
     * 获取所有的一级组织
     *
     * @return
     */
    @RequestMapping(value = "/sysOrg/getFirstLevelOrgList", method = RequestMethod.POST)
    List<GetFirstLevelOrgResponseVO> getFirstLevelOrgList();

    @RequestMapping(value = "/sysOrg/getChildOrgListByParentId", method = RequestMethod.POST)
    List<GetChildOrgListByParentIdResponseVO> getChildOrgListByParentId(@RequestBody GetChildOrgListByParentIdRequestVO vo);

    @RequestMapping(value = "/sysOrg/selectPage", method = RequestMethod.POST)
    PagerEntity selectPage(@RequestBody SelectOrgListRequestVO vo);

    @RequestMapping(value = "/sysOrg/selectDetail", method = RequestMethod.POST)
    SelectOrgDetailResponseVO selectDetail(@RequestBody SelectOrgDetailRequestVO vo);

    @RequestMapping(value = "/sysOrg/selectOrgByCode", method = RequestMethod.POST)
    SelectOrgByCodeResponseVO selectOrgByCode(@RequestBody SelectOrgByCodeRequestVO vo);

    @RequestMapping(value = "/sysOrg/selectOrgByCodeWithIsDeleted", method = RequestMethod.POST)
    SelectOrgByCodeResponseVO selectOrgByCodeWithIsDeleted(@RequestBody SelectOrgByCodeRequestVO vo);

    @RequestMapping(value = "/sysOrg/qryChildOrgListByParentId", method = RequestMethod.POST)
    BaseResult qryChildOrgListByParentId(@RequestBody GetChildOrgListByParentIdRequestVO vo);

}
